#!/usr/bin/env python
import roslib; roslib.load_manifest('beginner_tutorials')
import rospy
import serial
from time import sleep


def listener():	#Listener tipico de ROS
	while True:
		s.write("\xFF\x01\xB4")
		s.write("\xFF\x02\xB4")
		sleep(0.5)
		s.write("\xFF\x01\x80")
		s.write("\xFF\x02\x80")
		sleep(0.5)
		#input_var = input("Enter something: ")		
		#print ("you entered %s" % input_var)
		#s.write("\xFF\x01")
		#s.write(chr(input_var))

if __name__ == '__main__':
	s = serial.Serial() #Configuracion Serial
	s.port = "/dev/ttyS0"
	s.baudrate = 9600
	s.open()
	if s.isOpen(): 	
		print "serial open"
	
	listener()
